package qeb.handheldmedical.exam;

import qeb.handheldmedical.R;
import qeb.handheldmedical.model.User;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.Window;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.TextView;

/**
 * @author 作者(dugaoyi) E-mail:dugaoyi@163.com
 * @version 创建时间：2016年8月31日 下午2:43:50
 * @declaration
 */
public class LineExamMain extends Activity {
	User usr = new User();
	Button btnmsks, btnkjks, btnyjks, btnzjms, btnxxyy, btnlinexx, btnopenexam,
			btnqdqt, btnkjap;
	Button btn_title_back, btn_title_right;
	private TextView tv_top_title;

	/*
	 * (non-Javadoc)
	 * 
	 * @see android.app.Activity#onCreate(android.os.Bundle)
	 */
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		// TODO Auto-generated method stub
		super.onCreate(savedInstanceState);
		requestWindowFeature(Window.FEATURE_NO_TITLE);
		usr = (User) getIntent().getSerializableExtra("userinfo");
		setContentView(R.layout.exam_line_main);
		btnmsks = (Button) findViewById(R.id.btnmsks);
		btnmsks.setOnClickListener(MyOnClickListener);
		btnlinexx = (Button) findViewById(R.id.btnlinexx);
		btnlinexx.setOnClickListener(MyOnClickListener);
		btnkjks = (Button) findViewById(R.id.btnkjks);
		btnkjks.setOnClickListener(MyOnClickListener);
		btnyjks = (Button) findViewById(R.id.btnyjks);
		btnyjks.setOnClickListener(MyOnClickListener);
		btnzjms = (Button) findViewById(R.id.btnzjms);
		btnzjms.setOnClickListener(MyOnClickListener);
		btnqdqt = (Button) findViewById(R.id.btnqdqt);
		btnqdqt.setOnClickListener(MyOnClickListener);
		btnkjap = (Button) findViewById(R.id.btnkjap);
		btnkjap.setOnClickListener(MyOnClickListener);
		btn_title_back = (Button) findViewById(R.id.btn_title_back);
		btn_title_back.setOnClickListener(MyOnClickListener);
		btn_title_right = (Button) findViewById(R.id.btn_title_right);
		btn_title_right.setOnClickListener(MyOnClickListener);
		btn_title_back.setVisibility(View.GONE);
		btn_title_right.setVisibility(View.GONE);
		btnopenexam = (Button) findViewById(R.id.btnopenexam);
		btnopenexam.setOnClickListener(MyOnClickListener);

		btnxxyy = (Button) findViewById(R.id.btnxxyy);
		btnxxyy.setOnClickListener(MyOnClickListener);

		tv_top_title = (TextView) findViewById(R.id.tv_top_title);
		tv_top_title.setText("辅助");

	}

	private OnClickListener MyOnClickListener = new OnClickListener() {

		@Override
		public void onClick(View v) {
			// TODO Auto-generated method stub
			Intent intent = null;

			switch (v.getId()) {
			// 面授学习考试
			case R.id.btnmsks:
				intent = new Intent(LineExamMain.this,
						qeb.handheldmedical.exam.LineExam.class);
				intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
				intent.putExtra("examType", "1");
				intent.putExtra("userinfo", usr);
				LineExamMain.this.getApplicationContext().startActivity(intent);
				break;
			// 科室理论考试
			case R.id.btnkjks:
				intent = new Intent(LineExamMain.this,
						qeb.handheldmedical.exam.LineExam.class);
				intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
				intent.putExtra("examType", "2");
				intent.putExtra("userinfo", usr);
				LineExamMain.this.getApplicationContext().startActivity(intent);
				break;
			// 院级理论考试
			case R.id.btnyjks:
				intent = new Intent(LineExamMain.this,
						qeb.handheldmedical.exam.LineExam.class);
				intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
				intent.putExtra("examType", "3");
				intent.putExtra("userinfo", usr);
				LineExamMain.this.getApplicationContext().startActivity(intent);
				break;
			// 退回
			case R.id.btn_title_back:
				LineExamMain.this.finish();
				break;
			case R.id.btn_title_right:

				break;
			// 专家面授学习
			case R.id.btnzjms:
				intent = new Intent(LineExamMain.this,
						qeb.handheldmedical.exam.LineExam.class);
				intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
				intent.putExtra("examType", "4");
				intent.putExtra("userinfo", usr);
				LineExamMain.this.getApplicationContext().startActivity(intent);
				break;
			// 学习预约
			case R.id.btnxxyy:
				intent = new Intent(LineExamMain.this,
						qeb.handheldmedical.exam.AppointmentStudyList.class);
				intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
				intent.putExtra("userinfo", usr);
				LineExamMain.this.getApplicationContext().startActivity(intent);
				break;
			// 在线学习
			case R.id.btnlinexx:
				intent = new Intent(LineExamMain.this,
						qeb.handheldmedical.exam.LineExam.class);
				intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
				intent.putExtra("examType", "");
				intent.putExtra("userinfo", usr);
				LineExamMain.this.getApplicationContext().startActivity(intent);
				break;
			// 试卷开放
			case R.id.btnopenexam:
				intent = new Intent(LineExamMain.this,
						qeb.handheldmedical.exam.ExamOpenClose.class);
				intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
				intent.putExtra("examType", "99");
				intent.putExtra("userinfo", usr);
				LineExamMain.this.getApplicationContext().startActivity(intent);
				break;
			// 面授学习签到签退扫描
			case R.id.btnqdqt:
				intent = new Intent(LineExamMain.this,
						qeb.handheldmedical.exam.LineExam.class);
				intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
				intent.putExtra("examType", "98");
				intent.putExtra("userinfo", usr);
				LineExamMain.this.getApplicationContext().startActivity(intent);
				break;
			// 课件按排
			case R.id.btnkjap:
				intent = new Intent(LineExamMain.this,
						qeb.handheldmedical.exam.LineExam.class);
				intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
				intent.putExtra("examType", "6");
				intent.putExtra("userinfo", usr);
				LineExamMain.this.getApplicationContext().startActivity(intent);
				break;
			default:
				break;
			}
		}
	};
}
